Skip to content
  • 0 Votes
    3 Posts
    2k Views
    G
    I have published all the documentation in a Github repository. If someone wants to make PCBs, I recommend that you wait a little longer until you receive my PCBs and try them. https://github.com/giltesa/SmartHome
  • 1 Votes
    30 Posts
    7k Views
    G
    @dzungpham0703 I buy them on Aliexpress: https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180706102504&SearchText=HTTM If you apply hot air it is easy to take off the white "double sided tape" and the plastic.
  • Synchronising Light switch

    My Project light switch
    10
    1
    2 Votes
    10 Posts
    6k Views
    pepsonP
    Hi Can you help me convert this skecth for MySensors 2.2.0 because it was released. I upload to my Arduino MIni Pro this sketch but in Gateway Domoticz not show child to switch relay. Only show repeater child on ID 255. And also if you can please share me ready skecth for 2x releay. /* Relay with button sketch modified to work with no uplink to gateway and try to maintain sync to controller */ #define MY_DEBUG // Enable debug prints to serial monitor #define MY_RADIO_RFM69 #define MY_IS_RFM69HW #define RFM69_868MH #define MY_RFM69_NEW_DRIVER //#define MY_NODE_ID 203 // Node id defaults to AUTO (tries to fetch id from controller) #define MY_TRANSPORT_WAIT_READY_MS 5000 //set how long to wait for transport ready in milliseconds #define MY_REPEATER_FEATURE // Enabled repeater feature for this node #include <MySensors.h> #include <Bounce2.h> #define RELAY_PIN 5 // Arduino Digital I/O pin number for relay #define BUTTON_PIN 3 // Arduino Digital I/O pin number for button #define CHILD_ID 1 // Id of the sensor child #define RELAY_ON 1 #define RELAY_OFF 0 Bounce debouncer = Bounce(); int oldValue = 0; bool uplinkAvailable = true; bool state = false; bool requestState; bool firstStart = true; unsigned long uplinkCheckTime ; // holder for uplink checks unsigned long uplinkCheckPeriod = 30*1000; // time between checks for uplink in milliseconds unsigned long returnWait = 1000; // how long to wait for return from controller in milliseconds.. adjust as needed unsigned long oldTime = 0; unsigned long newTime = 0; MyMessage msg(CHILD_ID, V_STATUS); void setup(){ pinMode(BUTTON_PIN, INPUT_PULLUP); // Setup the button pin, Activate internal pull-up debouncer.attach(BUTTON_PIN); // After setting up the button, setup debouncer debouncer.interval(5); pinMode(RELAY_PIN, OUTPUT); // set relay pin in output mode digitalWrite(RELAY_PIN, RELAY_OFF); // Make sure relay is off when starting up } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("1xRelay & Button", "2.2.0"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID, S_BINARY); } void loop(){ if (firstStart) { // this code is only run once at startup Serial.println("First run started"); requestTime(); // get time from controller wait (returnWait); // delay to allow time to return if (oldTime == 0){ // check to see if there was a return from the time request Serial.println("uplink not available"); uplinkAvailable = false; // no uplink established uplinkCheckTime = millis(); } else{ Serial.println("uplink available"); request( CHILD_ID, V_STATUS); // get status of switch on controller wait (returnWait); //wait needed to allow request to return from controller Serial.print("controller state --- "); Serial.println(requestState); if (requestState != state) { // check that controller is corectly showing the current relay state send(msg.set(state), false); // notify controller of current state } } firstStart = false; // set firstStart flag false to prevent code from running again } debouncer.update(); int value = debouncer.read(); // Get the update value if (value != oldValue && value == 0) { // check for new button push state = !state; // Toggle the state digitalWrite(RELAY_PIN, state ? RELAY_ON : RELAY_OFF); // switch the relay to the new state requestTime(); wait (returnWait); // delay to allow time to return if (oldTime != newTime){ // if times are different then uplink is available send(msg.set(state), false); oldTime = newTime; } else{ // if times are the same no uplink is available Serial.println("uplink not available"); uplinkAvailable = false; // no uplink available, set flag false uplinkCheckTime = millis(); // start the timer from now } } oldValue = value; if (!uplinkAvailable && (millis() - uplinkCheckTime > uplinkCheckPeriod) ) { // test to see if function should be called uplinkCheck(); // call uplink checking function } } /*-------------------start of functions--------------------------*/ void receive(const MyMessage &message) { if (message.type == V_STATUS) { // check to see if incoming message is for a switch switch (message.getCommand()) { // message.getCommand will give us the command type of the incomming message case C_SET: //message is a set command from controller to update relay state state = message.getBool(); // get the new state digitalWrite(RELAY_PIN, state ? RELAY_ON : RELAY_OFF); // switch relay to new state uplinkAvailable = true; // uplink established /*---- Write some debug info----*/ Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); break; case C_REQ: // message is a returning request from controller requestState = message.getBool(); // update requestState with returning state break; } } } void uplinkCheck() { requestTime(); wait (returnWait); // wait for time return.. this may need to be varied for your system if (oldTime != newTime){ Serial.println("uplink re-established"); request( CHILD_ID, V_STATUS); wait (returnWait); //wait needed to allow request to return from controller if (requestState != state) { // check that controller is corectly showing the current relay state send(msg.set(state), false); // notify controller of current state no ack uplinkAvailable = true; // uplink established oldTime = newTime; } } uplinkCheckTime = millis(); // reset the checktime Serial.println("uplinkchecktime reset"); } void receiveTime(unsigned long time) { if (firstStart){ oldTime = time; newTime = time; } else{ newTime = time; } Serial.print("time received---- " ); Serial.println(time); }
  • 0 Votes
    6 Posts
    2k Views
    kalinaK
    Hi @blackchart, Unfortunately, all devices are sold out. Further production is possible only when ordering more than 10 devices (in this case, I also can modify the device to suit your needs).
  • Relay with Actuator issues

    Troubleshooting light switch relay button
    4
    0 Votes
    4 Posts
    2k Views
    Boots33B
    That's cool, just thought I would throw it into the pot. I don't use OpenHAB so can't be of much help there i'm afraid.
  • 2 Votes
    37 Posts
    11k Views
    kalinaK
    Hi @aramko-aramko. Unfortunately, this model is already sold. You can look at the upgraded version of this device - MDMSNode "Lighting" Rev 1.1.
  • 0 Votes
    21 Posts
    9k Views
    H
    Hi, nice projet. I am very interested in it. But why you are using 5 V and not 3.3 V? The ATmea328 works with 3.3 V too and the NRF have to use 3.3 V. The only restriction on 3.3 V is the clock limitation for the Atmega (8 MHz). But with no crystal it don't care. For example you could use an HLK-PM03 instead of HLK-PM01 and remove the linear voltage regulator. So you get more space an everything have the same voltage level. And another point is, it is recommended to use a capacitor (0.1 µF) to ground for each voltage pin (Vcc, Avcc, Aref).
  • 7 Votes
    226 Posts
    104k Views
    OldSurferDudeO
    What I didn't quite figure out was how it operates independently as a regular light switch. What I find most interesting is that this is 8 years old. There have been some incredible advances in the IoT world in that time. I was about to do a similar thing which morphed into an ESP-12F then added a touch screen. I call it the Universal Light Switch Imagine this: All the switches are identical. Any switch can easily be configured to control up to five devices ... and then changed, on-the-fly, to control a different set of devices. My design is part of a system that would require a controller (eg. Home Assistant), an MQTT broker, and receiving modules in the devices being switched. It's WiFI which assumes an access point. The DIY ULS is under $20 and the off-the-shelf receiving modules are under $10. (About the cost of a non-networked dimmer switch) If one doesn't have the controller and MQTT broker, they can run on an old (5 years?) computer (which is cheaper than an old RasberryPi). This project is a good one! OSD
  • 1 Votes
    13 Posts
    6k Views
    martinhjelmareM
    I've updated the docs at home-assistant.io with sketch examples. Look at the light example. https://home-assistant.io/components/light.mysensors/#example-sketch It's what I used for testing during development. It adds an RGB sensor/actuator also besides a dimmer, but you can just remove any references to rgb in the sketch. The dimmer slider will only be visible after turning on the light and clicking the entity in the gui to bring up the more info card.
  • 2 Votes
    245 Posts
    133k Views
    S
    @DavidZH - I really hate our electrical system here, but that is coming from an electronics guy, not a electrician. I like the idea of low voltage in the switches, however its AC. I would prefer to see DC, but the voltage drops might be something that they're attempting to avoid by sending AC instead. Yes, i agree about those damn rings and we also don't have the room here in the UK like you mentioned about the NL.

28

Online

11.7k

Users

11.2k

Topics

113.1k

Posts